Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Tools: Fix style and modality of errors in loader and creator #2489

Merged

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jan 5, 2022

Brief description

Error dialog in loader miss styles and is under Loader window if Loader tool has flag AlwaysOnTop. Also traceback could be collapsible.

Description

The error dialog does not have parent which would fix the modality and style issue. The traceback can extend the dialog to infinite size so it would be nice to have it collapsible and if the contet would be in QTextEdit which has scrollbars so the text size of traceback won't matter.

Changes

  • crated base for error dialogs for both creating and loading
    • added them to utils, they are not much generic but it can be easily changed now
    • have ability to copy report data with button if the method for returning the report data returns any data
  • LoadErrorMessageBox and CreateErrorMessageBox inherit from base ErrorMessageBox
  • parent is passed to LoadErrorMessageBox and CreateErrorMessageBox
    • this fixes style and modality of dialogs
  • openpype.style has new function get_style_image_path which returns path to image resources in style folder
  • copied ClickableFrame from new publisher to utils and extended it to 2 versions
  • implemented expanding button in utils

Resolves #2487

@mkolar
Copy link
Member

mkolar commented Jan 5, 2022

@iLLiCiTiT iLLiCiTiT changed the title fix style and dialog modality to parent widget Tools: Fix style and modality of errors in loader and creator Jan 5, 2022
@iLLiCiTiT iLLiCiTiT marked this pull request as ready for review January 5, 2022 17:56
@iLLiCiTiT iLLiCiTiT self-assigned this Jan 5, 2022
@iLLiCiTiT iLLiCiTiT added the type: enhancement Enhancements to existing functionality label Jan 5, 2022
Copy link
Member

@kalisp kalisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, it looks much nicer now.

@iLLiCiTiT iLLiCiTiT merged commit 3685ad9 into develop Jan 6, 2022
@mkolar mkolar deleted the feature/OP-2314_Error-message-in-Loader-is-not-on-top branch January 6, 2022 16:39
@BigRoy
Copy link
Collaborator

BigRoy commented Jan 6, 2022

For future reference. This is what it looks like after this PR:

The Crash Loader name is my custom Loader that forces an error with raise RuntimeError("Crash Loader") as shown here for testing purposes.

Closed
afbeelding

Open
afbeelding

Copied report:

During load error happened on Subset: "modelMain" Representation: "abc" Version: 2

Error message: Crash loader

Traceback (most recent call last):
  File "S:\openpype\OpenPype\openpype\tools\loader\widgets.py", line 1510, in _load_representations_by_loader
    options=options
  File "S:\openpype\OpenPype\repos\avalon-core\avalon\pipeline.py", line 1406, in load_with_repre_context
    return loader.load(repre_context, name, namespace, options)
  File "<maya console>", line 18, in load
RuntimeError: Crash loader

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message in Loader is not on top
4 participants